/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.autoescola.core.dao;

import com.autoescola.core.designerpatterns.TemplateMethod;
import javax.persistence.EntityManager;

/**
 *
 * @author leonardo luz fernandes
 * @version 0.1
 * @since 16/11/2010
 */
public abstract class CrudDaoFacade<EntityKey,Entity> implements CrudDao<EntityKey,Entity> {

    private Class<Entity> entityClazz;

    @TemplateMethod
    protected abstract EntityManager getEntityManager();

    public Entity create( Entity entity ){
        getEntityManager().persist(entity);
        return entity;
    }//end method

    public Entity load( EntityKey key ){
        return null;
    }//end mehtod



}//end klazz
